package com.alveole.tools;

public class Logger {
	
	public static int ERROR=-1;
	public static int SYSTEMINIT=0;
	public static int SYSTEMRUN=1;
	public static int USERINIT=2;
	public static int USERRUN=3;
	
	private static Logger logger;
	private static int maxlevel;
	public static Logger getLogger()
	{
		if (logger==null) logger=new Logger();
		maxlevel=USERRUN;
		return logger;
	}
	private void log_(int level,String data)
	{
		if (level<=maxlevel) System.out.print(data);
	}
	private void logln_(int level,String data)
	{
		if (level<=maxlevel) System.out.println(data);
	}
	public static void logln(int level,String data)
	{
		getLogger().logln_(level,data);
	}
	public static void log(int level,String data)
	{
		getLogger().log_(level,data);
	}
	public static void log(int level,String [] values)
	{
		for (int i =0 ; i<values.length;i++)
		{
			Logger.log(Logger.USERRUN, values);
			if (i!=values.length-1)
				Logger.log(Logger.USERRUN," ");
		}
	}

}
